<template>
	<view class="HotelRoomListData" @tap="goToReservationConfirm">
		<image :src="item.cover" mode="" class="housing"></image>
		<view class="info">
			<view class="left">
				<view class="top">
					<view class="top_left">
						{{ item.name }}
						<span class="top_right" style="padding: .3rem;">/{{ item.maxPeopleQuantity }}人入住</span>
					</view>
				</view>
				<view class="bottom">
					<view class="bottom_left">
						￥{{ item.price / 100 }}
						<span class="bottom_right" style="padding: .3rem;">/每晚</span>
					</view>
				</view>
			</view>
			<view class="right">
				立即预订
			</view>
		</view>
	</view>
</template>

<script>import { showToast } from "../../utils/promise"
	export default {
		name: "HotelRoomListData",
		data() {
			return {

			};
		},
		props: {
			item: {
				type: Object,
				default: {
				},
			}
		},
		methods: {
			goToReservationConfirm() {
				// let order = {"startDay":"2025.02.10","startWeekDay":"星期二","endDay":"2025.02.12","endWeekDay":"星期四",
				//               "orderType":"豪华套间","orderAmount":"5889","roomCount":"3","personCount":"5",}
				// this.item = order	
        const { roomCount, personCount } = this.item
				if (roomCount === 0) {
					showToast({
						title: '请选择房间数',
						icon: "error",
					})
					return
				}
				if (personCount === 0) {
					showToast({
						title: '请选择入住人员',
						icon: "error",
					})
					return
				}
				uni.navigateTo({
					url: "/pages/ReservationConfirmationPage/ReservationConfirmationPage?order="+JSON.stringify(this.item)
				});
			}
		},
	}
</script>

<style lang="less" scoped>
	.HotelRoomListData {
		width: 100%;
		background-color: rgb(255, 255, 255);
		box-sizing: border-box;

		.housing {
			width: 690rpx;
			height: 386rpx;
			margin: 0 auto;
			margin-top: 30rpx;

		}

		.info {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 32rpx;

			.left {
				display: flex;
				flex-direction: column;

				.top {
					display: flex;
					align-items: center;

					.top_left {
						// width: 136rpx;
						// height: 48rpx;
						font-weight: 500;
						font-size: 34rpx;
						// line-height: 48rpx;
						letter-spacing: 0px;
						text-align: center;
						color: #000000;

					}

					.top_right {
						margin-left: 20rpx;
						// width: 94rpx;
						// height: 36rpx;
						font-weight: 400;
						font-size: 26rpx;
						// line-height: 36rpx;
						letter-spacing: 0px;
						text-align: center;
						color: #979797;

					}
				}

				.bottom {
					display: flex;
					align-items: center;
					margin-top: 8rpx;

					.bottom_left {
						// width: 116rpx;
						// height: 48rpx;
						font-weight: 600;
						font-size: 34rpx;
						// line-height: 48rpx;
						letter-spacing: 0px;
						text-align: center;
						color: #FF4D00;
					}

					.bottom_right {
						// width: 52rpx;
						// height: 36rpx;
						font-weight: 400;
						font-size: 26rpx;
						// line-height: rpx;
						letter-spacing: 0px;
						text-align: center;
						color: #979797;
						margin-left: 12rpx;

					}
				}
			}

			.right {
				width: 200rpx;
				height: 72rpx;
				border-radius: 8rpx;
				background: #0F4C97;
				font-weight: 400;
				font-size: 28rpx;
				line-height: 72rpx;
				letter-spacing: 0px;
				color: #FFFFFF;
				text-align: center;

			}
		}


	}
</style>